Release 10.1A: OpenEdge Development:
ADM and SmartObjects
Get and set functions for object properties
A second mechanism that supports retrieving and setting property values is a naming convention that defines two groups of Progress functions called get and set functions. These functions are available for all properties that can be read or written by other objects:
- The
getfunctions, which have the formatgetpropname, retrieve the values of properties. They take no input parameters and each returns the associated property value with the native data type. If a property is write only, nogetfunction is available.- The
setfunctions, which have the formatsetpropname, set property values. They take as their onlyINPUTparameter the value of the associated property (which can be of any Progress data type) and each returns the typeLOGICAL:TRUEorFALSEdepending on whether thesetoperation was successful. If a property is read only, nosetfunction is available.If no special processing is needed to get or set a property, the
getandsetfunctions simply use the special include file syntax defined in the "ADMProps temp-table and object properties" section to access the appropriate field in the properties temp-table record for the SmartObject. For example:
The
getandsetfunctions are not restricted to such simple operations; they can perform whatever actions you need to set and get values, such as verifying the validity of values. For example, you could use the following pair of functions to get and set the value of the BackGround Color property (BGColor) of the default Progress Frame in an object such as a SmartDataViewer:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |